<style type="less">
  .group {}
</style>
<template>
  <view class="group">
    <text class="id">{{grouplist.id}}. </text>
    <text class="name" @tap="tap">{{grouplist.name}}</text>
    <view>
      <view v-for="item in grouplist.list" item="item">
        <groupitem :gitem="item"></groupitem>
      </view>
    </view>
  </view>
</template>
<script>
  import GroupItem from './groupitem'

  export default {
    props: {
      grouplist: {},
      index: {}
    }

    components: {
      groupitem: GroupItem
    }
    methods: {
      tap () {
        this.grouplist.name = `Parent Random(${Math.random()})`
        console.log(`Clicked Group ${this.$index}, ID is ${this.grouplist.id}`)
      }
    }
  }
</script>
